package com.jhs.kjs.model.daumMap.frame;


public abstract class ExtDirection implements ILatLng {

	public synchronized static int getCardinal(int angle){
		final double gab=22.5;
		double start = 11.25;
		
		
		if(angle>348.75 && angle <=361){
			return 0;
		}
		if(angle>=0 && angle <=start){
			return 0;
		}
			
		int dir = 1;
		while(start<361){
			if(angle>start && angle <=start+gab){
				return dir;
			}
			dir++;
			start+=gab;
		}
		return -1;
	}
	
	public synchronized static String getCardinalString(int cardinal){
		for(Cardinal car : Cardinal.values()){
			if(car.getIntDir() == cardinal){
				return car.getsDir();
			}
		}
		return "";
	}
}
